<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>2.过渡案例_vue实现</title>
    <script src="../js/vue.js"></script>
    <style>
        .picture{
            width: 100px;
        }
        /* 离开的起点 */
        .qiuku-leave{
            opacity: 1;
            transform: scale(1) rotate(0deg);
        }

        /* 离开的终点 */
        .qiuku-leave-to{
            opacity: 0;
            transform: scale(0.2) rotate(180deg);
        }
        /* 离开中(中间的过程 */
        .qiuku-leave-active{
            transition: 1s all linear;
        }
        /* 进入的起点(就是离开的终点) */
        .qiuku-enter{
            opacity: 0;
            transform: scale(0.2) rotate(180deg);
        }
        /* 进入的终点(离开的起点) */
        .qiuku-enter-to{
            opacity: 1;
            transform: scale(1) rotate(0deg);
        }
        /* 进入中 */
        .qiuku-enter-active{
            transition: 1s all linear;
        }
    </style>
</head>
<body>
    <div id="root">
        <button @click="isShow = !isShow ">切换</button><br>
        <transition name="qiuku">
            <img v-show="isShow" class="picture" src="https://s3.ax1x.com/2020/12/13/reCaqg.jpg" alt="">
        </transition>
    </div>

    <script>
        new Vue({
            el: '#root',
            data: {
                isShow: true
            }
        })
    </script>
</body>
</html>